<div class="index" >
  <h2>上传抽奖名单</h2>
  <%= form_tag(upload_csv_data_luckies_path, multipart: true) do %>
    <div >
      <%= file_field_tag :file, accept: '.xls, .xlsx' %>
    </div>
    <div class="upload_btn">
      <%= submit_tag '上传名单',class:'btn upload_excel', style: 'color: #fff; background-color: #e68354' %>
    </div>
  <% end %>

  <div>
    <%= link_to '抽奖页面', setting_luckies_path,class:'btn', style: 'color: #fff; background-color: #e68354' %>
  </div>
  <div class="download">
    <p><%= link_to '下载一等中签名单', download_lucky_list_luckies_path(type: 1),class:'btn btn-success', style: 'background: #f4b942;' %></p>
    <p><%= link_to '下载二等中签名单', download_lucky_list_luckies_path(type: 2),class:'btn btn-success', style: 'background: #f4b942;' %></p>
    <p><%= link_to '下载三等中签名单', download_lucky_list_luckies_path(type: 3),class:'btn btn-success', style: 'background: #f4b942;' %></p>
    <p><%= link_to '下载四等中签名单', download_lucky_list_luckies_path(type: 4),class:'btn btn-success', style: 'background: #f4b942;' %></p>
    <p><%= link_to '下载五等中签名单', download_lucky_list_luckies_path(type: 5),class:'btn btn-success', style: 'background: #f4b942;' %></p>
  </div>
</div>

<script>
  $('.upload_excel').click(function(){
    if(!$('#file').val()){
      alert('请先选择要上传的抽奖名单');
      return false;
    }
  })
</script>

